#include <stdio.h>
#include <stdlib.h>
#include "hash.h"

HashTable* create_hash(int size){
    HashTable *table = (HashTable*) malloc(sizeof(HashTable));
    if(table == NULL) {
        return table;
    }
    table -> size = size;
    table -> last_error = HASH_OK;
    table -> bucket = (HashEntry**) malloc(sizeof(HashEntry*) * size);
    if(table -> bucket == NULL) {
        table -> last_error = HASH_ERROR;
        free(table);
    }
    return table;
}